/** 椤甸潰鍔犺浇 */
$(document).ready(function(){

	var type = 1;
	var subType = 2;
	queryStuDetail(type,subType);
	
	$(".studentMenu").click(function(){
		type = $(this).attr("type");
		subType = $(this).attr("subType");
		if(type  == "1"){
			$("#stuDetailTitle").text("学业情况");
		}else if(type == "2"){
			$("#stuDetailTitle").text("生活情况");
		}else{
			$("#stuDetailTitle").text("财务情况");
		}
		queryStuDetail(type,subType);
	});
});

function queryStuDetail(type , subType){
	$("#id").html("<table id='grid_stuinfo'></table><div style='display: none;'></div>")
	$('#grid_stuinfo').datagrid({ 
		url:"findStuDetailList.html?stuDetail.stuName="+$("#stuNameSpan").text()+"&stuDetail.type="+type+"&stuDetail.subType="+subType,
		fit:true,
		fitColumns:true, 
		singleSelect:true,
		pageSize:20,   
	    pageNumber:1,
		columns:[[    
			{field:'id',title:'资料ID',width:100,resizable:false,align:'center'}, 
			{field:'name',title:'资料名称',width:120,resizable:false,align:'center'},
			{field:'createDate',title:'创建日期',width:120,resizable:false,align:'center'},
			{field:'url',title:'',hidden:true},
			{field:'option',title:'操作',width:60,resizable:false,align:'center',
				formatter:function(value,rowData){
		        return "<a  style='font-size:normal;color:#cc0000;cursor:pointer;' href='downLoadStuInfo.html?url="+rowData.url+"&fileName="+rowData.name+"'>【下载】</a>&nbsp;";
					}
			}]],
		pagination:true,
	});
	
}